package main

import (
	"github.com/gin-gonic/gin"
	"go-web/config"
	"go-web/model"
	"go-web/router"
)

//TIP <p>To run your code, right-click the code and select <b>Run</b>.</p> <p>Alternatively, click
// the <icon src="AllIcons.Actions.Execute"/> icon in the gutter and select the <b>Run</b> menu item from here.</p>

func main() {

	//初始化配置 + 数据库连接
	config.InitConfig()
	//task.InitScheduler()
	//config.InitXXlJob()
	config.DB.AutoMigrate(&model.User{}, &model.ShortLink{}, &model.Book{}, &model.Member{}, &model.Borrow{})
	r := gin.Default()

	router.SetupRouter(r)

	r.Run(":8080")
}
